<script type="text/javascript" charset="utf-8">

$(function(){
	
	var url_contact_us =  "<?=site_url(); ?>index.php";
	
	// Init stage page
	
	$('.right .videos').hide(); // video panels disable default	
	
	// Add even to buttons
	$('.buts >a').each(function(index){
		
		// Set default index to active 
		var default_index = 1;
			
		// Select default index active
		if (index == default_index)
		{
			$(this).addClass('active');
		}
		
		// Each button item add event 
		$(this).click(function(){
			
			// Select navigation
			$(this)
				.parents('.buts')
					.find('>a')
						.removeClass('active')
					.end()
				.end()
				.addClass('active');
			
			// Get text inner anchor
			var text = $(this).text().toLowerCase();
			
			// Check if current anchor is phim's anchor and text equal 'phim'
			if ($(this).hasClass('p'))		
			{
				// Active video class
				$('.right .videos').show();
				// Disable pics class
				$('.right .pics').hide();
				
				return false;
			}
			
			// Else current anchor not phim's anchor
			// Active video class
			$('.right .pics').show();
			// Disable pics class
			$('.right .videos').hide();
			
			return false;
		});
	});
	
});

</script>

<div class="buts">
	<a href="#" class="button p">Phim</a>
	<a href="#" class="button h">Hình ảnh</a>   
	<div style="clear:both"></div>                         
</div>

<div class="videos">

	<?php $this->load->view($video_components);?>

</div>
<div class="pics">
	
	<?php $this->load->view($picture_components);?>
	
</div>


